<script setup lang="ts">
function handleClickLeft() {
  uni.navigateBack()
}
function toSort() {}
function toAdd() {
  uni.navigateTo({ url: '/pages/unit/unitAdd' })
}
</script>

<template>
  <view class="h-full flex flex-col overflow-hidden">
    <wd-navbar title="单位管理" left-text="返回" left-arrow @click-left="handleClickLeft" />
    <scroll-view
      class="box-border flex-1 overflow-hidden p-[10px]"
      scroll-y
      :show-scrollbar="false"
    >
      <custom-cell-item title="公斤" :tags="['默认', '称重']" value="" />
      <custom-cell-item title="克" value="" class="mt-[10px]" />
    </scroll-view>
    <view class="flex border-t-1 border-border border-t-solid bg-white p-4">
      <wd-button type="text" @click="toSort">
        <view class="flex flex-col items-center justify-center">
          <view class="i-icon-park-outline-sort-two text-main" />
          <text class="mt-1 text-[10px] text-main leading-none">单位排序</text>
        </view>
      </wd-button>
      <wd-button type="primary" :round="false" class="ml-4 flex-1" @click="toAdd">
        新建单位
      </wd-button>
    </view>
  </view>
</template>

<style scoped lang="scss"></style>
